package com.hopu.dy.service.impl;

import com.hopu.dy.mapper.FollowNoticeMapper;
import com.hopu.dy.pojo.FollowNotice;
import com.hopu.dy.service.IFollowNoticeService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class FollowNoticeServiceImpl implements IFollowNoticeService {

    @Resource
    private FollowNoticeMapper followNoticeMapper;

    @Override
    public void createFollowNotice(FollowNotice notice) {
        notice.setCreateTime(new Date());
        followNoticeMapper.insert(notice);
    }

    @Override
    public List<FollowNotice> getFollowNotices(Long followedUserId) {
        return followNoticeMapper.selectByFollowedUserId(followedUserId);
    }
}